<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /**
       * @param {character[]} s
       * @return {void} Do not return anything, modify s in-place instead.
       */
      var reverseString = function (s) {
        // s.reverse()
        var temp = null;
        for (var i = 0; i < Math.floor(s.length / 2); i++) {
          temp = s[i];
          s[i] = s[s.length - 1 - i];
          s[s.length - 1 - i] = temp;
        }
        return s;
      };

      var s = ["H", "a", "n", "n", "a", "h"];
      console.log(reverseString(s));
    </script>
  </body>
</html>
